package com.zhoumy.processor;

import org.springframework.beans.BeansException;
import org.springframework.beans.factory.config.BeanFactoryPostProcessor;
import org.springframework.beans.factory.config.ConfigurableListableBeanFactory;

/**
 * @author xf
 * @description 工厂后处理器
 * @date 2019/5/22 14:05
 */
public class CustomBeanFactoryPostProcessor implements BeanFactoryPostProcessor {

    public CustomBeanFactoryPostProcessor() {
        System.out.println("第1步：这是BeanFactoryPostProcessor(工厂后处理器)实现类CustomBeanFactoryPostProcessor的构造器！！");
    }

    @Override
    public void postProcessBeanFactory(ConfigurableListableBeanFactory configurableListableBeanFactory) throws BeansException {
        System.out.println("第2步：调用BeanFactoryPostProcessor(工厂后处理器)实现类CustomBeanFactoryPostProcessor的方法postProcessBeanFactory。ApplicationContext容器初始化中refresh()中调用");
    }
}